package org.atlantis.netty.time;

import java.net.InetSocketAddress;
import java.util.concurrent.Executors;

import org.jboss.netty.bootstrap.ClientBootstrap;
import org.jboss.netty.channel.ChannelFactory;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory;

public class TimeClient {

	public static void main(String[] args) {
		ChannelFactory factory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(),
				Executors.newCachedThreadPool());
		ClientBootstrap bootstrap = new ClientBootstrap(factory);
		ChannelPipeline pipeline = Channels.pipeline();
		pipeline.addLast("time-client-handler", new TimeClientHandler());
		bootstrap.setPipeline(pipeline);
		bootstrap.connect(new InetSocketAddress("127.0.0.1", 8081));
	}
}
